{% load i18n %}
{% load gravatar %}

{% for invitation in invitations %}
  <li class="module-item">
    <span>
      {% if invitation.to_user %}
        {% gravatar invitation.to_user.email 24 %}
        <a href="{% url "profiles_profile_detail" invitation.to_user.username %}">
          {{ invitation.to_user.get_full_name|default:invitation.to_user.username }}
        </a>
      {% else %}
        {% gravatar invitation.to_email 24 %}
        {{ invitation.to_email }}
      {% endif %}
    </span>
    <span class="quiet">
      {% if invitation.expired %}
        {% trans "Invitation expired" %}
      {% else %}
        {% trans "Invitation pending" %}
      {% endif %}
    </span>
    <ul class="module-item-menu">
      <li>
        <form action="{% url "invitations_revoke" invitation.pk %}" method="post">
          {% csrf_token %}
          <input type="submit" value="{% trans "Revoke" %}">
        </form>
      </li>
    </ul>
  </li>
{% endfor %}
